package rad.framework.conv;

import rad.framework.conv.DomImportCommand;
import java.util.ArrayList;
import java.util.List;

import rad.framework.seam.SampleEntity;

import org.w3c.dom.Element;

public class SampleDomImportCommand extends DomImportCommand<SampleEntity> {

	public SampleDomImportCommand() {
		super("java:/rad-framework-commons");
	}

	@Override
	protected Object transform(List<Element> nodes) {
		List<SampleEntity> list = new ArrayList<SampleEntity>();
		for (Element node : nodes) {
			// System.out.println("NNODE: " + node);
			SampleEntity entity = new SampleEntity();
			map(node, entity, "id");
			map(node, entity, "name");
			map(node, entity, "type");
			list.add(entity);
		}
		return list;
	}
}
